﻿@using QDT.Core.Members
@model QDT.Common.IPagedList<QDT.Core.Members.User>
@section HeadSection {
    <script type="text/javascript">
        function account(user_id) {

            var url = '@Url.Action("Account")' + '?id=' + user_id;

            showAjaxResult(url, "会员账户", 600, 200);
        }
    </script>
    @Html.IncludeCSS("~/Content/Css/calendar.css")
    @Html.IncludeScript("~/Content/JS/calendar.js")
}
<div class="main_title">
    会员列表</div>
<div class="blank5">
</div>
<div class="button_row">
    <a class="button" href="@Url.Action("Add")">新增</a> @*    <a class="button" href="javascript: del()">删除</a>*@
</div>
<div class="blank5">
</div>
<div class="search_row">
    <form name="search" action="@Url.Action("Index")" method="get">
    会员ID：<input type="text" class="textbox" name="userid"  size="8" value="@Request.Params["userid"]"/>
    会员名称：<input type="text" class="textbox" size="8" name="username" value="@Request.Params["username"]"/>
    Email:<input type="text" class="textbox" size="8" name="email" value="@Request.Params["email"]" />
    真名:<input type="text" class="textbox" size="8" name="realname" value="@Request.Params["realname"]" />
    手机号码:<input type="text" class="textbox" size="8" name="mobile" value="@Request.QueryString["mobile"]"/>
    分类:
    <select name="groupId">
        <option value="-1">所有分类</option>
        @foreach (var group in ViewData["UserGroups"] as IList<UserGroup>)
        {
            <option value="@group.ID">@group.Name</option>
        }
    </select>
    日期：<input type="text" class="textbox" id="createTime" name="createTime" value="@Request.Params["createTime"]" onfocus=" this.blur(); return showCalendar('createTime', '%Y-%m-%d', false, false, 'btn_CreateTime');" size="8"/>
    <input type="button" class="button" id="btn_CreateTime" value="选择时间" onclick=" return showCalendar('createTime', '%Y-%m-%d', false, false, 'btn_CreateTime'); " />
    <input type="submit" class="button" value="搜索" />
    页数：<input type="text" class="textbox" size="1" name="page" value="@Request.Params["page"]"/>
    </form>
</div>
<div class="grid_box">
    <div class="grid_top">
    </div>
    @Html.Grid(Model).Columns(column =>
{
    column.CheckBox(x => x.ID);
    column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;align:center;");
    column.For(x => Html.ActionLink(x.UserName, "Edit", new
    {
        id = x.ID
    })).Named("会员名称").SortColumnName("UserName");
    column.For(x => Html.F().GetUserGroup(x.GroupID)).Named("会员组").SortColumnName("GroupID");
    column.For(x => x.RealName).Named("真名");
    column.For(x => x.IDCard).Named("身份证号").SortColumnName("IDCard");
    column.For(x => x.Email).Named("邮箱").SortColumnName("Email");
    column.For(x => x.Mobile).Named("手机号");
    column.For(x => x.UserAccount.Money).Named("会员余额").Format("{0:C2}").SortColumnName("UserAccount.Money");
    column.For(x => x.UserAccount.LockMoney).Named("冻结资金").Format("{0:C2}").SortColumnName("UserAccount.LockMoney");
//    column.For(x => x.UserAccount.ExpMoney).Named("体验金").Format("{0:C2}").SortColumnName("UserAccount.ExpMoney");
    column.For(x => x.LoginIP).Named("最后登录IP");
    column.For(x => x.CreateTime).Named("注册时间");
    column.For(x => Html.F().GetUserName(x.RecommendID)).Named("推荐人");
    column.Buttons(btns => btns.Add(x => Html.ActionLink("编辑", "Edit", new { id = x.ID }))
                               .Add(x => Html.ScriptLink("账户", "account({0})", x.ID))
                               .Add(x => Html.ActionLink("明细", "AccountDetail", new { id = x.ID }))
                               .Add(x => Html.ActionLink("统计", "UserSta", new { id = x.ID }))
        );
}).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
@Html.Pager(Model)
